<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<title>新增/修改部门</title>
<link rel="icon" href="favicon.ico" type="image/ico">
<meta name="keywords" content="">
<meta name="description" content="">
{sys:load href="admin/css/bootstrap.min.css,admin/css/materialdesignicons.min.css,admin/css/style.min.css,admin/lib/layui/css/layui.css"}
</head>

<body>
<div class="container-fluid p-t-15">

  <div class="row">
    <div class="col-lg-12">
      <div class="card">
        <div class="card-body">

          <form action="/admin/worker/savedata" method="post" class="row" id="worker">
            <div class="form-group col-md-12">
              <label for="username">职员姓名:</label>
              <input type="text" class="form-control" id="username" name="username" value="{$detail.username}" placeholder="请输入职员姓名" autocomplete="off" />
            </div>

            <div class="form-group col-md-12">
              <label for="mobile">职员手机号:</label>
              <input type="text" class="form-control" id="mobile" name="mobile" value="{$detail.mobile}" placeholder="请输入职员手机号" autocomplete="off" />
            </div>

            <div class="form-group col-md-12">
              <label for="job_number">职员工号/工牌号:</label>
              <input type="text" class="form-control" id="job_number" name="job_number" value="{$detail.job_number}" placeholder="请输入职员工号" autocomplete="off" />
            </div>

            <div class="form-group col-md-12">
              <label for="passwd">登陆密码:</label>
              <input type="text" class="form-control" id="passwd" name="passwd" value="" placeholder="留空表示不修改密码" autocomplete="off" />
            </div>

            <div class="form-group col-md-12">
              <label for="department">所属部门:</label>
              <div class="form-controls">
                <select name="depart_id" class="form-control" id="department">
                  {volist name="departs" id="depart"}
                  <option value="{$key}" {if condition="$key == $detail['depart_id']"}selected{/if}>{$depart}</option>
                  {/volist}
                </select>
              </div>
            </div>

            <div class="form-group col-md-12">
              <label for="join_time">入职时间:</label>
              <input type="text" class="form-control js-datepicker" id="join_time" name="join_time" value="{$detail.join_time}" placeholder="" autocomplete="off" />
            </div>

            <div class="form-group col-md-12">
              <label for="birth_time">生日:</label>
              <input type="text" class="form-control js-datepicker" id="birth_time" name="birth_time" value="{$detail.birth_time}" placeholder="" autocomplete="off" />
            </div>

            <div class="form-group col-md-12">
                <input type="hidden" name="id" value="{$detail.id}" >
              <button type="button" class="btn btn-primary btn-submit" form-id="worker">确 定</button>
            </div>
          </form>

        </div>
      </div>
    </div>

  </div>

</div>
{sys:load href="admin/lib/layui/layui.js,admin/common.js"}
<script type="text/javascript">
    layui.use(['Request','jquery','layer','laydate'], function(){
        var Request = layui.Request,$ = layui.jquery,layer = layui.layer,laydate = layui.laydate;
        $(".btn-submit").click(function(){
            Request.postInSubmit(".btn-submit", function(response){
                layer.msg('操作成功', {time:1000}, function(){
                    parent.location.reload();
                })
            })
        });

        laydate.render({
            elem: '#join_time'
        });
        laydate.render({
            elem: '#birth_time'
        })
    })
</script>
</body>
</html>
